# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#

add_executable(
  pollux_aggregates_test
  AggregationFunctionRegTest.cpp
  ApproxDistinctTest.cpp
  ApproxMostFrequentTest.cpp
  ApproxPercentileTest.cpp
  ArbitraryTest.cpp
  ArrayAggTest.cpp
  AverageAggregationTest.cpp
  BitwiseAggregationTest.cpp
  BoolAndOrTest.cpp
  CentralMomentsAggregationTest.cpp
  ChecksumAggregateTest.cpp
  ClassificationAggregationTest.cpp
  CountAggregationTest.cpp
  CountDistinctTest.cpp
  CountIfAggregationTest.cpp
  CovarianceAggregationTest.cpp
  EntropyAggregationTest.cpp
  GeometricMeanTest.cpp
  HistogramTest.cpp
  Main.cpp
  MapAccumulatorTest.cpp
  MapAggTest.cpp
  MapUnionAggregationTest.cpp
  MapUnionSumTest.cpp
  MaxSizeForStatsTest.cpp
  MinMaxByAggregationTest.cpp
  MinMaxTest.cpp
  MultiMapAggTest.cpp
  PrestoHasherTest.cpp
  ReduceAggTest.cpp
  SetAggTest.cpp
  SetUnionTest.cpp
  SumDataSizeForStatsTest.cpp
  SumTest.cpp
  VarianceAggregationTest.cpp)

add_test(
  NAME pollux_aggregates_test
  COMMAND pollux_aggregates_test
  WORKING_DIRECTORY .)

target_link_libraries(
  pollux_aggregates_test
  pollux_aggregates
  pollux_core
  pollux_dwio_common_test_utils
  pollux_exec
  pollux_exec_test_lib
  pollux_file
  pollux_functions_aggregates
  pollux_functions_aggregates_test_lib
  pollux_functions_window_test_lib
  pollux_functions_test_lib
  pollux_functions_prestosql
  pollux_functions_lib
  pollux_hive_connector
  pollux_simple_aggregate
  pollux_type
  pollux_vector_fuzzer
  pollux_temp_path
  GTest::gtest
  GTest::gtest_main)
